package com.wgts.wgts.mvp.presenter.imp;

import com.wgts.wgts.mvp.model.IWgtsMyFansActivityModel;
import com.wgts.wgts.mvp.presenter.IWgtsMyFansActivityPresenter;
import com.wgts.wgts.mvp.view.IWgtsMyFansActivityView;
import com.wgts.wgts.netmodle.HttpResultSubscriber;
import com.wgts.wgts.netmodle.resp.WgtsFansSummyEntity;

import java.util.List;

public class WgtsMyFansActivityPresenter implements IWgtsMyFansActivityPresenter {

    private IWgtsMyFansActivityView view;

    private IWgtsMyFansActivityModel model;

    public WgtsMyFansActivityPresenter(IWgtsMyFansActivityView view, IWgtsMyFansActivityModel model) {
        this.view = view;
        this.model = model;
    }


    @Override
    public void wgtsFansSum(String relationLevel) {
        model.wgtsFansSum(relationLevel, new HttpResultSubscriber<List<WgtsFansSummyEntity>>() {
            @Override
            public void onSuccess(List<WgtsFansSummyEntity> wgtsFansSummyEntities) {
                view.initFans(wgtsFansSummyEntities);
            }

            @Override
            public void _onError(int status, String msg) {
                view.onError(status, msg);
            }
        });
    }
}
